'''
Created on Nov 29, 2011

@author: dstu
'''

from MaterialClass import *

class ProfessionName(object):
    '''
    A container class to hold the various conjugations of the name of a
    profession, e.g. "glazier", "glaziers", "glazier's", "glaziers'".
    '''

    singular = ""
    plural = ""
    singularPossessive = ""
    pluralPossessive = ""
    
    def __init__(self, singular = None, plural = None,
                 singularPossessive = None, pluralPossessive = None):
        '''
        Constructor.  The defaults are for testing purposes.
        '''
        
        if not singular:
            self.__init__("glazier")
            
        else:
            singular = singular.lower()
            self.singular = singular
            
            if not plural:
                self.plural = singular + "s"
            else:
                self.plural = plural
                
            if not singularPossessive:
                self.singularPossessive = singular + "'s"
            else:
                self.singularPossessive = singularPossessive
            
            if not pluralPossessive:
                self.pluralPossessive = singular + "s'"
            else:
                self.pluralPossessive = pluralPossessive
    
    
    def getSingular(self):
        return self.singular
    
    def getPlural(self):
        return self.plural
    
    def getSingularPossessive(self):
        return self.singularPossessive
    
    def getPluralPossessive(self):
        return self.pluralPossessive
    
    def __str__(self):
        return ", ".join([self.getSingular(), self.getPlural(), self.getSingularPossessive(), self.getPluralPossessive()])
    
    def __repr__(self):
        return "ProfessionName(" + self.__str__() + ")"






class Profession(object): 
    '''
    classdocs
    '''

    materialSet = MaterialSet()

    def __init__(self, 
                 names,   # Should be a ProfessionName object
                 materialSet  # Should be a MaterialSet object
                 ):
        '''
        Constructor
        '''
        self.names = names
        self.materialSet = materialSet
        
    def getNames(self):
        return self.names
    
    def getMaterialSet(self):
        return self.materialSet
    

def main(): 
    '''
    Some fun testing code
    '''
    
    p1 = ProfessionName()
    print p1
    
    p2 = ProfessionName("smith")
    print p2
    
    p3 = ProfessionName("seamstress", "seamstresses", "seamstress's", "seamstress'")
    print p3
    
    p4 = ProfessionName("seamstress", "seamstresses", pluralPossessive = "seamstress'")
    print p4
    

if __name__ == "__main__":
    main() 
    